<template>
    <div>
        <h1>CompC</h1>
        <p>{{ name }}</p>
        <p>{{ age }}</p>
        <p>count: {{ count }}</p>
        <button @click="setCount(100)">修改count</button>
        <button @click="age++">age++</button>
    </div>
</template>

<script setup>
import { inject } from 'vue';

const name = inject("name");
const age = inject("age");
const { count, setCount } = inject("count");

console.log(name.value);
console.log(age.value);

</script>

<style scoped></style>